package org.je.log;

import org.je.ufo.Sleep;

class LogThread extends Thread
{
	private final LogBuffer[]	buffers	= new LogBuffer[2];

	public LogThread(LogBuffer info, LogBuffer error) {
		buffers[0] = info;
		buffers[1] = error;
		this.setDaemon(true);
	}

	@Override
	public void run() {
		while (true) {

			JLog.updateTime();//

			Sleep.millis(1000);
			for (LogBuffer bf : buffers) {
				try {
					bf.clearBuffer();
				} catch (Throwable ex) {}
			}
		}
	}
}
